define(["jquery", "easy-admin"], function ($, ea) {

    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTableRenderId',
        index_url: 'cost.budget/index',
        add_url: 'cost.budget/add',
        edit_url: 'cost.budget/edit',
        delete_url: 'cost.budget/delete',

    };

    var Controller = {

        index: function () {
            ea.table.render({
                init: init,
                toolbar:['refresh', 'add', 'delete'],
                cols: [[
                    {type: "checkbox"},
                    // {field: 'id', width: 80, title: 'ID',search: false},
                    {field: 'budget_time', minWidth: 80, title: '日期', search: 'range',templet: ea.table.date_to_month_time},
                    {field: 'classify.title', minWidth: 100, title: '分类名称'},
                    {field: 'company.company_name', minWidth: 100, title: '城市划分'},
                    {field: 'budget_price', minWidth: 100, title: '预算金额'},
                    {field: 'remark', minWidth: 100, title: '备注信息',search: false},
                    // {field: 'create_time', minWidth: 80, title: '创建时间', search: false},
                    {width: 250, title: '操作', templet: ea.table.tool}
                ]],
            });

            ea.listen();
        },
        add: function () {
            ea.listen();
        },
        edit: function () {
            ea.listen();
        },
    };
    return Controller;
});